<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('所有待办列表')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                流程名称：<input type="text" name="processName">
                            </li>
                            <li>
                                任务名称：<input type="text" name="taskName">
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "task/manage";

        function showForm(taskname, formKey) {
            $.modal.openTab(taskname , formKey);
        }

        $(function() {
            var options = {
                url: prefix + "/alllist",
                modalName: "我的待办任务",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'taskId',
                    title: '任务编号',
                    visible: false
                },
                {
                    field: 'taskName',
                    title: '任务名称'
                },
                {
                    field: 'processInstanceId',
                    title: '流程实例编号'
                },
                {
                    field: 'executionId',
                    title: '执行实例编号'
                },
                {
                    field: 'businessKey',
                    title: '业务号'
                },
                {
                    field: 'processName',
                    title: '流程名称'
                },
                {
                    field: 'starter',
                    title: '发起人'
                },
                {
                    field: 'assignee',
                    title: '办理人'
                },
                {
                    field: 'createTime',
                    title: '任务创建时间'
                },
                {
                    field: 'startTime',
                    title: '流程启动时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-danger btn-xs href="javascript:void(0)" onclick="showForm(\''+ row.taskName + '\',\'' + row.formKey + '?taskid=' + row.taskId +'\' )"><i class="fa fa-envelope-open"></i>办理</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);


        });
    </script>
</body>
</html>